/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package View;

import java.awt.Dimension;
import java.awt.Toolkit;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JTextArea;
import javax.swing.JTextField;

/**
 *
 * @author CCD gruppe 2
 */
public class AddUserFrame extends javax.swing.JFrame {

    private javax.swing.JCheckBox SecretaryCheckBox;
    private javax.swing.JButton createUserButton;
    private javax.swing.JTextArea ekspertiseTextArea;
    private javax.swing.JTextField epostField;
    private javax.swing.JCheckBox fasilitatotCheckBox;
    private javax.swing.JTextField fullNameTextField;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JCheckBox projectLeaderCheckBox;
    private javax.swing.JTextField workPlaceTextField;

    /** Creates new form AddUser */
    public AddUserFrame() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {

        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        fullNameTextField = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        workPlaceTextField = new javax.swing.JTextField();
        createUserButton = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        ekspertiseTextArea = new javax.swing.JTextArea();
        projectLeaderCheckBox = new javax.swing.JCheckBox();
        fasilitatotCheckBox = new javax.swing.JCheckBox();
        SecretaryCheckBox = new javax.swing.JCheckBox();
        jLabel2 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        epostField = new javax.swing.JTextField();

        jLabel3.setText("Ekspertise:");

        jLabel4.setText("F.eks: Programmering, analyse...etc");

        jLabel6.setText("Fullt navn:");

        jLabel1.setText("Arbeidsplass:");

        createUserButton.setText("Opprett bruker");

        ekspertiseTextArea.setColumns(20);
        ekspertiseTextArea.setRows(5);
        jScrollPane1.setViewportView(ekspertiseTextArea);

        projectLeaderCheckBox.setText("Prosjektleder");

        fasilitatotCheckBox.setText("Fasilitator");

        SecretaryCheckBox.setText("Sekretær");

        jLabel2.setText("Mulige roller:");

        jLabel7.setText("Epost:");

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(layout.createSequentialGroup()
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jLabel3)
                            .add(jLabel6))
                        .add(25, 25, 25)
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 346, Short.MAX_VALUE)
                            .add(jLabel5)
                            .add(jLabel4)
                            .add(fullNameTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 346, Short.MAX_VALUE)
                            .add(epostField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 346, Short.MAX_VALUE))
                        .addContainerGap())
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jLabel1)
                            .add(jLabel2))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
                                .add(projectLeaderCheckBox)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                                .add(fasilitatotCheckBox)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                                .add(SecretaryCheckBox))
                            .add(org.jdesktop.layout.GroupLayout.LEADING, workPlaceTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 345, Short.MAX_VALUE))
                        .addContainerGap())))
            .add(layout.createSequentialGroup()
                .add(112, 112, 112)
                .add(createUserButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 351, Short.MAX_VALUE)
                .addContainerGap())
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(jLabel7)
                .addContainerGap(421, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel7)
                    .add(epostField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(18, 18, 18)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(fullNameTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 26, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLabel6))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jLabel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jLabel5)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(layout.createSequentialGroup()
                        .add(4, 4, 4)
                        .add(jLabel3))
                    .add(layout.createSequentialGroup()
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE)))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel1)
                    .add(workPlaceTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(projectLeaderCheckBox)
                    .add(jLabel2)
                    .add(fasilitatotCheckBox)
                    .add(SecretaryCheckBox))
                .add(18, 18, 18)
                .add(createUserButton)
                .addContainerGap())
        );
        pack();
        setCenterPos(this);

    }// </editor-fold>

    /*
     * Getters and setters
     */

    public JCheckBox getSecretaryCheckBox() {
        return SecretaryCheckBox;
    }

    public JButton getCreateUserButton() {
        return createUserButton;
    }

    public JTextArea getEkspertiseTextArea() {
        return ekspertiseTextArea;
    }

    public JTextField getEpostField() {
        return epostField;
    }

    public JCheckBox getFasilitatotCheckBox() {
        return fasilitatotCheckBox;
    }

    public JTextField getFullNameTextField() {
        return fullNameTextField;
    }

    public JCheckBox getProjectLeaderCheckBox() {
        return projectLeaderCheckBox;
    }

    public JTextField getWorkPlaceTextField() {
        return workPlaceTextField;
    }

    /**
     * A method that clears the input
     */
    public void clearInputt() {
        workPlaceTextField.setText("");
        fullNameTextField.setText("");
        epostField.setText("");
        ekspertiseTextArea.setText("");
        SecretaryCheckBox.setSelected(false);
        fasilitatotCheckBox.setSelected(false);
        projectLeaderCheckBox.setSelected(false);

    }

    private static void setCenterPos(JFrame frame) {
        Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
        int x = (int) ((screen.getWidth() - frame.getWidth()) / 2);
        int y = (int) ((screen.getHeight() - frame.getHeight()) / 2);
        frame.setLocation(x, y);
    }
}

